# Dockerfile 优化（添加独立依赖层）
FROM base_centos7_jdk8_maven:latest

# 先单独复制pom.xml利用缓存
WORKDIR /app
# 拷贝 pom.xml 到 镜像
COPY pom.xml .
# 再复制源码构建
COPY ruoyi-admin  ./ruoyi-admin
COPY ruoyi-common  ./ruoyi-common
COPY ruoyi-framework  ./ruoyi-framework
COPY ruoyi-generator  ./ruoyi-generator
COPY ruoyi-quartz  ./ruoyi-quartz
COPY ruoyi-system  ./ruoyi-system

# 执行 maven 下载 jar
RUN mvn install

# 打包
RUN mvn package

# 运行时配置...
EXPOSE 8090

# 启动应用
ENTRYPOINT ["java", "-jar", "ruoyi-admin/target/ruoyi-admin.jar"]